package com.example.demo.controller;

import com.example.demo.Permission;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lee
 * @date 2021年06月17日 14:15
 */
@RestController
public class Test {

    private static final int admin = 4;

    @GetMapping("/")
    public String test() {
        return "hello world";
    }

    @GetMapping("/index/{name}/{age}")
    @Permission(value = 1)
    public String test2(@PathVariable String name, @PathVariable String age) {
        return "hello " + name + "|" + age;
    }

}
